<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>注册页面</title>
	<link rel="stylesheet" href="/lixingxing/lixingxing/Public/home/css/login.css">
	<link rel="stylesheet" href="/lixingxing/lixingxing/Public/home/css/bootstrap.min.css">
	<script src="/lixingxing/lixingxing/Public/home/js/jquery.min.js"></script>
	<script src="/lixingxing/lixingxing/Public/home/js/jquery.validate.min.js"></script>
	<script src="/lixingxing/lixingxing/Public/home/js/bootstrap.min.js"></script>
	<script>
		$(function(){
			$("#register").validate({
			    rules: {
			      user: {
			      	required:true,
			      },
			      password: {
			      	required:true,
			      	rangelength:[6,12]
			      },
			      password1: {
			      	required:true,
			      	rangelength:[6,12],
			      	equalTo:"#password"
			      },
			    },
			    messages: {
			      user: {
			      	required:"请输入您的注册账户"
			      },
			      password:{
			      	required:"请输入您的注册密码",
			      	rangelength:"密码长度为6-12位"	
			      },
			      password:{
			      	rangelength:"密码长度为6-12位",
			      	equalTo:"密码不一致"
			      }
			    },
			    // 当验证失败的时候会做的事情
				errorPlacement: function(error, element) { 
					console.log(error);
					console.log(element);
					element.parents(".form-group").append(error);
					element.parents(".form-group").addClass("has-error");
				},success: function(element) {
					// alert(element.html());
					element.parents(".form-group").removeClass("has-error");
					element.remove();
				}
			});
		})
	</script>
</head>
<body>
	<!--注册页面-->
		<div class="container">
		<!-- Nav tabs -->
			<div class="nav nav-tabs row text-center" role="tablist">
				<h3 class="hw-layer-title">用户注册
        		<a href="index.php" class="btn btn-success">返回首页</a>
                </h3>
			</div>
			<div role="tabpanel" class="tab-pane" id="profile1">
				<form class="form-horizontal" id="register">
					<div class="form-group">
					    <label class="col-sm-2 control-label col-sm-offset-1">账号</label>
					    <div class="col-sm-6">
					    	<input type="text"  class="form-control" id="user" name="user" placeholder="请填写您所注册的账号">
						</div>
					</div>
					<div class="form-group">
					    <label class="col-sm-2 control-label col-sm-offset-1">密码</label>
					    <div class="col-sm-6">
					     	<input type="password"  class="form-control" id="password" name="password" placeholder="请填写您所注册的密码">
						</div>
					</div>
					<div class="form-group">
					    <label class="col-sm-2 control-label col-sm-offset-1">重复密码</label>
					    <div class="col-sm-6">
					     	<input type="password"  class="form-control" id="password1"
					     	name="password1" placeholder="亲，请再次确认密码">
						</div>
					</div>
				  	<div class="form-group">
				    	<div class="col-sm-offset-3 col-sm-10">
				      		<button type="submit" class="btn btn-default btn-primary">注册</button>
				    	</div>
					</div>
				</form>
			</div>
		</div>	
</body>
</html>